
import defaultData from "../../common/data/defaultData";
import cache from "../../common/js/cache";
export default ({
	namespaced: true,
	state: {
		theme:uni.getStorageSync(cache.settingTheme) || {
			type:'day',
			modeColor:"#fb7299",
			modeFontColor:"white"
		},
		taskbar:uni.getStorageSync(cache.settingTaskbar) || {
			state:true,
			data:defaultData.taskbarData
		}
	},
	mutations: {
        SETTHEME(state,theme){
			state.theme = {...state.theme,...theme}
			uni.setStorageSync(cache.settingTheme,state.theme)
		},
		SETTASKBAR(state,taskbar){
			state.taskbar = {...state.taskbar,...taskbar}
			uni.setStorageSync(cache.settingTaskbar,state.taskbar)
		},
	},
	actions: {}
})